/**
 * 授权 API
 */
import {
	http
} from '../request/main.js'

/**
 * 获取配置数据
 * 
 * @returns {Promise}
 */
export function getConfig() {
	return http.post('/common/getConfig', {}, {
		muteLogin: true
	})
}

/**
 * 获取微信配置数据
 * 
 * @returns {Promise}
 */
export function getMpConfig(url) {
	return http.post('/common/getMpConfig', {
		url
	}, {
		muteLogin: true
	})
}

/**
 * 上传图片
 * 
 * @returns {Promise}
 */
export function uploadImage(imageUrl) {
	return http.post('/api/common/upload', {
		file: {
			file: imageUrl,
			name: 'file'
		}
	}, {
		removeAddon: true,
		uploadFile: true
	})
}
